package com.yinNuo.collectWool.core.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: yinNuo
 * create at: 2021/3/29 15:08
 * @description: WebConfigurer配置类
 */
@Configuration
public class WebConfigurer implements WebMvcConfigurer {
    @Autowired
    private Interceptor interceptor;

    /**
     * 设置拦截器
     * 增加对rest api鉴权的spring mvc拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceptor).addPathPatterns("/**")
                //放行的拦截请求
                .excludePathPatterns("","/","/loginIn","/resign","/forget","/forget");
    }
}